package com.aegis.manage.controller.sys;

import com.aegis.common.mybatis.base.BaseController;
import com.aegis.manage.api.request.AddMenuRequest;
import com.aegis.manage.api.request.QueryMenuRequest;
import com.aegis.manage.api.vo.MenuVO;
import com.aegis.manage.service.sys.menu.SysMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author renogo
 *
 * @Version 1.0
 * @Descritube
 */
@RestController
@RequestMapping("/sys/menu")
@Api(tags = "系统-菜单管理")
public class SysMenuController extends BaseController<SysMenuService> {

    @PostMapping
    @ApiOperation(value = "添加菜单", notes = "添加菜单")
    public void addMenu(@RequestBody @Validated AddMenuRequest request) {
        getService().addMenu(request);
    }


    @GetMapping("/tree")
    @ApiOperation(value = "查询菜单树", notes = "查询菜单树")
    List<MenuVO> selectMenuTree(QueryMenuRequest request) {
        return getService().selectMenuTree(request);
    }

}
